﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReestablecerContrasena.aspx.cs" Inherits="ReestablecerContrasena" %>

<%@ Register src="MenuSuperior.ascx" tagname="MenuSuperior" tagprefix="uc1" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Estilos.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style2
        {
            height: 20px;
            text-align: left;
        }
        .style3
        {
            text-align: right;
        }
        .style4
        {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <uc1:MenuSuperior ID="MenuSuperior1" runat="server" />
        
        <table align="center">
            <tr>
                <td>
                    <asp:LoginView ID="LoginView1" runat="server">
                        <AnonymousTemplate>
                            Debe iniciar sesión para cambiar la contraseña
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            <asp:ChangePassword ID="ChangePassword1" runat="server" 
                                CancelDestinationPageUrl="~/CAInicio.aspx" 
                                ContinueDestinationPageUrl="~/CAInicio.aspx">
                            </asp:ChangePassword>
                        </LoggedInTemplate>
                        <RoleGroups>
                            <asp:RoleGroup Roles="Administrador">
                                <ContentTemplate>
                                    <table align="center">
                                        <tr>
                                            <td colspan = "2" style="text-align: center" >
                                                <strong>Cambiar contraseña</strong>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                Usuario</td>
                                            <td class="style4">
                                                <asp:DropDownList ID="ddlUsuarios" runat="server" DataSourceID="dsUsuarios" 
                                                    DataTextField="ApellidoYNombre" DataValueField="UsuarioId" >
                                                </asp:DropDownList>
                                                <asp:ObjectDataSource ID="dsUsuarios" runat="server" 
                                                    SelectMethod="ObtenerTodosLosUsuarios" 
                                                    TypeName="RC.ControlAcceso.ObjetosNegocio.CA2Usuario">
                                                </asp:ObjectDataSource>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                Contraseña nueva</td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtContrasenanueva" runat="server" MaxLength="12" 
                                                    TextMode="Password"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                    ControlToValidate="txtContrasenanueva" ErrorMessage="*" 
                                                    ToolTip="Debe ingresar una contraseña"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                Repetir contraseña</td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtContrasenarepetir" runat="server" MaxLength="12" 
                                                    TextMode="Password"></asp:TextBox>
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                                    ControlToCompare="txtContrasenanueva" ControlToValidate="txtContrasenarepetir" 
                                                    ErrorMessage="*" ToolTip="Las contraseñas no coinciden" ValueToCompare="Text"></asp:CompareValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style2">
                                            </td>
                                            <td class="style2">
                                                <dxe:ASPxButton ID="btnEstablecer" runat="server" 
                                                    CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                    CssPostfix="Office2003_Olive" Text="Establecer" 
                                                    onclick="btnEstablecer_Click">
                                                </dxe:ASPxButton>
                                            </td>
                                        </tr>
                                        
                                    </table>
                                </ContentTemplate>
                            </asp:RoleGroup>
                        </RoleGroups>
                    </asp:LoginView>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                    
        <asp:Label ID="lblMensaje" runat="server" Visible="False"></asp:Label>
        
                </td>
            </tr>
        </table>
        
        <br />
        
    </div>
    </form>
</body>
</html>
